package com.hmall.common.utils;


public class UserUtil {
    private static ThreadLocal<Long> holder = new ThreadLocal<>();

    /**
     * 获取值
     * @return {@link Long}
     */
    public static Long getParameter() {
        return holder.get();
    }

    /**
     * 保存值
     * @param userId
     */
    public static void setParameter(Long userId) {
        holder.set(userId);
    }

    public static void remove(){
        holder.remove();
    }
}
